const path = require('path');

module.exports = {
  entry: {
    'main': path.resolve(__dirname, './index.tsx'),
    'animation-demo': path.resolve(__dirname, './animation/animation-demo.ts'),
    'gesture-demo': path.resolve(__dirname, './gesture/gesture-demo.ts'),
  },
  mode: 'development',
  cache: false,
  resolve: {
    extensions: ['.js', '.ts', '.tsx'],
  },
  devtool: 'eval-source-map',
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: [
              '@babel/preset-env',
              '@babel/preset-typescript',
            ],
            plugins: [
              [
                '@babel/plugin-transform-react-jsx',
                {
                  pragma: 'createElement',
                }
              ]
            ],
          },
        }
      },
    ],
  },
};
